package com.chinact.saas.tenant.orggroup.domain;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import com.chinact.platform.util.DateUtil;

/**
 * Title: ChinaCT SaaS
 * <p>
 * Description: 组织组织归口（单位归口）信息表
 * <p>
 * Copyright: 2008
 * <p>
 * Company: Liaoning Open Data Communication Co.,Ltd.
 *
 * @author lihui
 * @version 1.0.0
 */
public class OrgGroupObj implements Serializable {
	/*
	 * 数据表名称
	 */
	public static final String TABLE_NAME = "SAAS_ORG_GROUP";

	/*
	 * 数据表主键
	 */
	public static final String TABLE_ID = "ORGGROUP_ID";

	/*
	 * 数据表主键
	 */
	public static final String TABLE_LOGIC_ID = "ORGGROUP_LOGIC_ID";

	private static final long serialVersionUID = -1380371318868376865L;

	// 编号
	private String id;
	// 组织归口逻辑ID
	private String logicId;
	// 组织归口名称
	private String orgGroupName;
	// 组织归口排序号（倒序）
	private Integer orgGroupOrder;
	// 组织归口描述
	private String orgGroupMemo;
	// 所属租户ID
	private String organIds;
	// 所属租户名称
	private String organName;
	// 建立时间
	private Date createTime;
	// 创建人
	private String createPerson;
	// 更新时间
	private Date updateTime;
	// 更新人
	private String updatePerson;
	// 扩展字段
	private String ext1;
	// 扩展字段
	private String ext2;
	// 扩展字段
	private String ext3;

	// ################### 临时数据 ####################

	// 字符串类型的时间
	private String createTimeStr;
	// 字符串类型的时间
	private String updateTimeStr;

	/**
	 * 比较两个对象是否相等
	 *
	 * @param other
	 *            要比较的对象
	 * @return boolean 相同返回true，否则返回flase
	 */
	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof OrgGroupObj)) {
			return false;
		}
		final OrgGroupObj obj = (OrgGroupObj) other;
		return new EqualsBuilder().append(this.getLogicId(), obj.getLogicId()).isEquals();
	}

	/**
	 * 得到对象的哈希值
	 *
	 * @return int 对象的哈希值
	 */
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(this.getLogicId()).toHashCode();
	}

	/**
	 * 返回对象的字符串值
	 *
	 * @return String 表示对象的字符串值
	 */
	@Override
	public String toString() {
		return new ToStringBuilder(this).append("组织组织归口（单位归口）信息表", this.getOrgGroupName()).toString();
	}

	/**
	 * 将DATE类型的时间格式化为字符串类型
	 *
	 * @author lihui
	 * @return 字符串时间
	 */
	public String getCreateTimeStr() {
		if (this.createTime != null) {
			this.createTimeStr = DateUtil.showTime(this.createTime);
		}
		return this.createTimeStr;
	}

	public void setCreateTimeStr(final String createTimeStr) {
		this.createTimeStr = createTimeStr;
	}

	/**
	 * 将DATE类型的时间格式化为字符串类型
	 *
	 * @author lihui
	 * @return 字符串时间
	 */
	public String getUpdateTimeStr() {
		if (this.updateTime != null) {
			this.updateTimeStr = DateUtil.showTime(this.updateTime);
		}
		return this.updateTimeStr;
	}

	public void setUpdateTimeStr(final String updateTimeStr) {
		this.updateTimeStr = updateTimeStr;
	}

	public String getId() {
		return id;
	}

	public void setId(final String id) {
		this.id = id;
	}

	public String getOrgGroupName() {
		return orgGroupName;
	}

	public void setOrgGroupName(final String orgGroupName) {
		this.orgGroupName = orgGroupName;
	}

	public Integer getOrgGroupOrder() {
		return orgGroupOrder;
	}

	public void setOrgGroupOrder(final Integer orgGroupOrder) {
		this.orgGroupOrder = orgGroupOrder;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(final Date createTime) {
		this.createTime = createTime;
	}

	public String getExt1() {
		return ext1;
	}

	public void setExt1(final String ext1) {
		this.ext1 = ext1;
	}

	public String getExt2() {
		return ext2;
	}

	public void setExt2(final String ext2) {
		this.ext2 = ext2;
	}

	public String getExt3() {
		return ext3;
	}

	public void setExt3(final String ext3) {
		this.ext3 = ext3;
	}

	public String getLogicId() {
		return logicId;
	}

	public void setLogicId(final String logicId) {
		this.logicId = logicId;
	}

	public String getOrgGroupMemo() {
		return orgGroupMemo;
	}

	public void setOrgGroupMemo(final String orgGroupMemo) {
		this.orgGroupMemo = orgGroupMemo;
	}

	public String getOrganIds() {
		return organIds;
	}

	public void setOrganIds(final String organIds) {
		this.organIds = organIds;
	}

	public String getOrganName() {
		return organName;
	}

	public void setOrganName(final String organName) {
		this.organName = organName;
	}

	public String getCreatePerson() {
		return createPerson;
	}

	public void setCreatePerson(final String createPerson) {
		this.createPerson = createPerson;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(final Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdatePerson() {
		return updatePerson;
	}

	public void setUpdatePerson(final String updatePerson) {
		this.updatePerson = updatePerson;
	}

}
